﻿using System.Collections.Generic;
using System;

namespace VirtualRink.Library
{
    public interface IRepository
    {
		VirtualRinkModelDataContext Context { get; }
        League CreateLeague(string name);
        Conference CreateConference(string name, League league);
        Division CreateDivision(string name, Conference conference);
        Team CreateTeam(string name, string location, string owner, string coach, Division division);
        Player CreatePlayer(League league, string firstName, string lastName, int number, string shoots, string position);
        Contract DraftPlayer(Team team, Player player);
        void TradePlayers(Team team1, Player player1, Team team2, Player player2);
        Contract GetLatestContract(Player player);
        Contract ReleasePlayer(Team team, Player player);
		void SubmitChanges();
		IEnumerable<Player> GetAvailablePlayers(League league);
		IEnumerable<Player> GetAvailablePlayers(League league, string position);
		Season CreateSeason(League league, DateTime startDate);
		IEnumerable<Game> GetPlayedGames(Season season);
        IList<Team> GetTeamsByLeague(int leagueId);
		void UpdateStandings(Season season, List<Standing> newStandings);
        IList<Game> GetGamesWithoutPerformanceSummaries(int seasonId);
        PlayerSeasonPerformance GetPlayerSeasonPerformance(int playerId, int seasonId);
        TeamSeasonPerformance GetTeamSeasonPerformance(int teamId, int seasonId);
        IEnumerable<Game> GetGamesByDate(Season season, DateTime dateTime);
		IEnumerable<Standing> GetStandings(int seasonId);
		IEnumerable<Game> GetTeamSchedule(int seasonId, int teamId);
	}
}
